package com.example.bigeventMaven.Detail;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.stereotype.Controller;
import java.util.List;

/**
 * Created by 10446 on 2017/9/9.
 */
@Controller
public class DetailController {

    @Autowired
    DetailService detailService;


    @RequestMapping("/detail/{id}")
    String getDetail(@PathVariable String id ,Model model){

        Detail detail= detailService.getDetail(id);
        model.addAttribute("header",detail.getHeader());
        model.addAttribute("time",detail.getTime());
        model.addAttribute("detail",detail.getDetail());
        return "detail";
    }
}
